home *** CD-ROM | disk | FTP | other *** search
/ Hyper Animation Series: Viper (Limited Edition) / Hyper Animation Series: VIPER (Limited Edition).iso / pc / SYSTEM / class / PlayerShipDestroy.class (.txt) < prev    next >
Encoding:
Java Class File  |  1998-08-04  |  2.0 KB  |  63 lines

  1. class PlayerShipDestroy extends PlayerShipAction {
  2.    private int fxSpeedX;
  3.    private int fxSpeedY;
  4.    private int fxWeight;
  5.  
  6.    public PlayerShipDestroy(StgFrame var1) {
  7.       super(var1);
  8.       short var2 = (short)('ΘÇÇ' + (Fixed.Random() >> 4));
  9.       int var3 = 655360 + (Fixed.Random() << 1);
  10.       this.fxWeight = 32768;
  11.       this.fxSpeedX = Fixed.Sin(var2);
  12.       this.fxSpeedY = Fixed.Cos(var2);
  13.       this.fxSpeedX = Fixed.Mul(this.fxSpeedX, var3);
  14.       this.fxSpeedY = Fixed.Mul(this.fxSpeedY, var3);
  15.    }
  16.  
  17.    public boolean action(PlayerShipIndex var1) {
  18.       PlayerShip var2 = super.resource.getPlayerShip();
  19.       ((StgObjectIndex)var1).movePosition(this.fxSpeedX, this.fxSpeedY, 0);
  20.       this.fxSpeedY += this.fxWeight;
  21.       if (((StgObjectIndex)var1).cliping()) {
  22.          var1.getNomalShot().deleteAll();
  23.          ((StgObject)var2).delete(var1);
  24.          this.destroy(var1);
  25.          return true;
  26.       } else {
  27.          return true;
  28.       }
  29.    }
  30.  
  31.    boolean destroy(PlayerShipIndex var1) {
  32.       Status var2 = super.resource.getStatus();
  33.       int var3 = var2.getPlayerShipStock();
  34.       int var4 = var2.getContinue();
  35.       JglFrame var5 = super.resource.getResource();
  36.       Sound var6 = var5.getSE();
  37.       Sound var7 = var5.getBGM();
  38.       if (var3 != 0) {
  39.          int var8 = var1.getPower();
  40.          if (var8 != 0) {
  41.             --var8;
  42.          }
  43.  
  44.          super.resource.putPlayerShip(0, var8, 2, 0);
  45.          var2.setPlayerShipStock(var3 - 1);
  46.       } else {
  47.          var7.stop(16);
  48.          if (var4 != 0) {
  49.             super.resource.getGameProcess().setAttr(2);
  50.             var2.setContinue(var4 - 1);
  51.          } else {
  52.             Enemy var9 = super.resource.getEnemy();
  53.             ((StgObject)var9).deleteAll();
  54.             super.resource.getStatus().deleteDisp();
  55.             var6.play(20);
  56.             super.resource.setGameProcess(new RankingProcess(super.resource));
  57.          }
  58.       }
  59.  
  60.       return false;
  61.    }
  62. }
  63.